/********************************************************************************
* @File name: oled.h
* @Author: Loganx
* @Blog: https://www.cnblogs.com/loganxiang
* @Version: 1.0(2025-10-09)
* @Description: STC8H单片机0.96寸OLED显示（128*64）
********************************************************************************
* 本软件使用了STC的STC8H官方库；
********************************************************************************/
#ifndef _LGX_OLED
#define _LGX_OLED

#include "lib/Config.h"
#include "lib/STC8A_GPIO.h"
#include "lib/STC8A_I2C.h"
#include "lib/STC8A_NVIC.h"
#include "lib/STC8A_Switch.h"

#define OLED_ADDR_DEV		0x78

#define OLED_MEM_DATA		0x40
#define OLED_MEM_CMD		0x00

#define OLEDSendData(dat)	I2C_WriteNbyte(OLED_ADDR_DEV,OLED_MEM_DATA,&dat,1)
#define OLEDSendCmd(cmd)	I2C_WriteNbyte(OLED_ADDR_DEV,OLED_MEM_CMD,&cmd,1)

extern uint8 code LogoBMP[];

void OLEDInitialize(void);

void OLEDSetPos(uint8 x, uint8 y);
void OLEDClear(void);
void OLEDPrintChar(uint8 x,uint8 y,uint8 chr);
void OLEDPrintString(uint8 x,uint8 y,uint8 *str);
void OLEDDrawBMP(uint8 *pbmp);

#endif  
	 



